<template>
  <div style="line-height:1.8">
    <div v-if="qType==1" v-loading="qLoading">
      <div class="q-title" v-html="question.stem"/>
      <div class="q-content">
        <span class="q-item-prefix">A. </span>
        <span class="q-item-content">{{ question.optionA }}</span><br/>
        <span class="q-item-prefix">B. </span>
        <span class="q-item-content">{{ question.optionB }}</span><br/>
        <span class="q-item-prefix">C. </span>
        <span class="q-item-content">{{ question.optionC }}</span><br/>
        <span class="q-item-prefix">D. </span>
        <span class="q-item-content">{{ question.optionD }}</span><br/>
      </div>
    </div>
    <div v-else-if="qType==2" v-loading="qLoading">
      <div class="q-title" v-html="question.stem"/>
      <div class="q-content">
        <span style="display:block" class="q-item-content" v-for="item in question.option" :key="item.name"
              v-html="`${item.name.slice(6)}.${item.content}`"></span><br/>
      </div>
    </div>
    <div v-else-if="qType==3" v-loading="qLoading">
      <div class="q-title" v-html="question.stem" style="display: inline;margin-right: 10px"/>
      <span>（</span>
      <span :key="item.id" v-for="item in question.items">
        <span v-html="item.content" class="q-item-content"></span>
       </span>
      <span>）</span>
    </div>
  </div>

</template>

<script>
export default {
  name: 'QuestionShow',
  props: {
    question: {
      type: Object,
      default: function () {
        return {}
      }
    },
    qLoading: {
      type: Boolean,
      default: false
    },
    qType: {
      type: Number,
      default: 0
    }
  },
  methods: {}
}
</script>

<style scoped>
.q-title, .q-content {
  text-align: left;
  padding-left: 4px;
}

.q-title {
  font-weight: 700;
  font-size: 18px;
  color: rgb(5, 5, 5) !important;
}
</style>
